package com.whz.governance.redislimiter.command;

import java.util.ArrayList;
import java.util.List;

/**
 * @author whz
 */
public final class ScriptParams {
    private final List<String> keys = new ArrayList<>(4);
    private final List<Object> args = new ArrayList<>(4);

    private ScriptParams() {
    }

    public static ScriptParams create() {
        return new ScriptParams();
    }

    public ScriptParams addKey(String key) {
        this.keys.add(key);
        return this;
    }

    public ScriptParams addArg(Object arg) {
        this.args.add(arg);
        return this;
    }

    public List<String> getKeys() {
        return this.keys;
    }

    public Object[] getArgs() {
        return this.args.toArray(new Object[0]);
    }
}